﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using GeoSpatial;

namespace GeoSpatialTest {
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class PointTest {
        public PointTest() {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void TestMethod1() {
            //
            // TODO: Add test logic	here
            //
        }

        /// <summary>
        /// Test a valid value for Y
        ///</summary>
        [TestMethod()]
        public void YTest() {
            Point target = new Point(); // TODO: Initialize to an appropriate value
            double expected = 42; // TODO: Initialize to an appropriate value
            double actual;
            target.Y = expected;
            actual = target.Y;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        /// Test Y must be greater than 0
        ///</summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void YTestGreaterThan0() {
            Point target = new Point(); // TODO: Initialize to an appropriate value
            double expected = -1; // TODO: Initialize to an appropriate value
            target.Y = expected;
        }

        /// <summary>
        /// Test Y must be less than 180
        ///</summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void YTestLessThan180() {
            Point target = new Point(); // TODO: Initialize to an appropriate value
            double expected = 182; // TODO: Initialize to an appropriate value
            target.Y = expected;
        }

        /// <summary>
        ///A test for X
        ///</summary>
        [TestMethod()]
        public void XTest() {
            Point target = new Point(); // TODO: Initialize to an appropriate value
            double expected = 0F; // TODO: Initialize to an appropriate value
            double actual;
            target.X = expected;
            actual = target.X;
            Assert.AreEqual(expected, actual);
        }
    }
}
